package com.vrp3d.common.enums;

import com.vrp3d.common.exceptions.CommonException;

/**
 * 语言枚举
 *
 * @author vrp3d
 */
public enum LanguageTypeEnum {

    /**
     * sql中分类type
     */
    zh("中文", "zh"),
    en("英文", "en"),
    ar("阿拉伯文", "ar"),
    ja("日文", "ja"),
    ko("韩文", "ko"),
    es("西班牙语", "es"),
    ;

    private String description;
    private String msg;

    public static LanguageTypeEnum getNewsEnum(String language) {
        for (LanguageTypeEnum languageTypeEnum : LanguageTypeEnum.values()) {
            if (language.equals(languageTypeEnum.getMsg())) {
                return languageTypeEnum;
            }
        }
        throw new CommonException(CommonExceptionEnum.LANGUAGE_TYPE_ABNORMAL);
    }

    LanguageTypeEnum(String description, String msg) {
        this.description = description;
        this.msg = msg;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
